package experiment_04_Pram;

import java.util.concurrent.Callable;

public class GetMaxNumber implements Callable<Integer> {
	int left, right;
	int[] array;

	public GetMaxNumber(int[] array, int lower, int upper) {
		this.array = array;
		this.left = lower;
		this.right = upper;
	}

	@Override
	public Integer call() throws Exception {
		// for (int i = left; i <= right; i++) {
		// System.out.print(array[i] + " ");
		// }
		// System.out.println();
		int max = array[left];
		for (int i = left + 1; i <= right; i++) {
			if (max < array[i]) {
				max = array[i];
			}
		}
		// System.out.println(max);
		return max;
	}
}
